core/: Introduce rsa feature flag to avoid ring dependency#2860
core/: Introduce rsa feature flag to avoid ring dependency#2860mxinden merged 11 commits intolibp2p:masterfrom
rsa feature flag to avoid ring dependency#2860Conversation
thomaseizinger
left a comment
There was a problem hiding this comment.
Generally, I am happy to land this change. Please see inline comments :)
thomaseizinger
left a comment
There was a problem hiding this comment.
Thank you for doing all the version updates and changelog entries!
One more question and I'd like to have @mxinden's review on this as well before we merge it.
One more note on this, I am pretty sure |
|
|
rsa feature flag to avoid ring dependency
thomaseizinger
left a comment
There was a problem hiding this comment.
Thanks!
One more note regarding using the new dep syntax.
| Ok(PublicKey(X25519(pk))) | ||
| } | ||
|
|
||
| #[allow(irrefutable_let_patterns)] |
There was a problem hiding this comment.
This is unfortunate :/
There was a problem hiding this comment.
Yes, but I don't know how to change this without a massive rewrite :(
|
Thanks for adopting the suggestions so quickly. Just waiting for @mxinden now :) |
rsa feature flag to avoid ring dependencyrsa feature flag to avoid ring dependency
mxinden
left a comment
There was a problem hiding this comment.
Thanks for the patch and thanks for following this all the way through, updating the many versions 🙏.
This looks good to me apart from one thing.
The libp2p-core feature secp256k1 is passed through to libp2p. In addition the secp256k1 is part of the libp2p default feature.
According to the libp2p specification:
Implementations MUST support Ed25519. Implementations SHOULD support RSA if they wish to interoperate with the mainline IPFS DHT and the default IPFS bootstrap nodes. Implementations MAY support Secp256k1 and ECDSA, but nodes using those keys may not be able to connect to all other nodes.
https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#key-types
I read this as rsa taking a higher priority as secp256k1. Thus I suggest passing the rsa feature through libp2p and adding rsa to the default feature on libp2p. That would as well remove the breaking change, i.e. the removal of default support for decoding rsa keys.
@GamePad64 @thomaseizinger does the above reasoning make sense?
|
Yes, this makes sense to me :) Added |
thomaseizinger
left a comment
There was a problem hiding this comment.
@mxinden That sounds good to me.
It is a breaking change regardless though. A user depending on the crate with disabled default features will not get RSA support whereas previously, they did.
👍 I will point this out in the release notes on #2869. |
|
🎉 first pull request running the interop tests #2835 //CC @laurentsenta. |
…p#2860) - Introduce `rsa` feature flag to `libp2p-core`. - Expose `rsa` feature in `libp2p`. - Add `rsa` feature to `libp2p` `default`.
Description
I've tried to build libp2p for router, running mips cpu, but the build has failed because of ring dependency. Ring is used mainly for RSA in libp2p-code, so I've made rsa as an optional feature
Links to any relevant issues
#1396
#1975
Open Questions
Change checklist